package com.indusfo.spc.mapper;

import com.indusfo.spc.pojo.Badreply;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface BadreplyMapper {

    //添加不良对策
    int insertBadreply(Badreply badreply);

    //根据ID查询
    List<Badreply> selectByPrimaryKey(Badreply badreply);

    //修改不良对策
    int updateByPrimaryKeySelective(Badreply record);

    //查询所有不良对策
    List<Badreply> selectAll(Badreply badreply);
    // 查询所有不良对策   及其子类
    List<Badreply> queryBadreplyByBadreplyTypeId(@Param("badreply") Badreply badreply, @Param("badreplyTypeIds") List<Integer> badreplyTypeIds);

    //查询不良对策是否存在
    Integer selectBadreply(Badreply badreply);

    //1 启用  2 删除  3停用 不良对策
    int delteBadreply(@Param("badreplyIds") Long[] badreplyIds, @Param("dataState") Integer dataState);

    //查询总数
    int countBadreply(Badreply badreply);
    // 查询总数   及其子类
    int countBadreplyByBadreplyTypeId(@Param("badreply") Badreply badreply, @Param("badreplyTypeIds") List<Integer> badreplyTypeIds);

    //根据不良对策类ID  批量删除
    int delteBadreplyByBadreplyTypeId(Badreply badreply);



}